<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var test = {
            a: '我是对象属性a',
            b() {
                console.log('我是对象方法b')
            }
        }
        var a = '我是普通变量a';
        function b() {
            console.log('我是函数b')
        }
        console.log(a);
        b();
        console.log('---------------- window对象调用属性和方法 -----------')
        console.log(window.a);
        window.b();
        console.log('---------------- 普通对象的调用 --------------------')
        console.log(test.a)
        test.b();
    </script>
</body>

</html>